<template>
	<view class="seckill">
		<view :class="device=='ios'?'ios_pageTitle':'and_pageTitle'">
			<view class="statusBar"></view>
			<view :class="['pageTitle','dFlex','jStart_aCenter']">
				<view class="backIcon imgPublic" @tap.stop='back'>
					<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/back3.png" mode='widthFix'></image>
				</view>
				<view class="searchBox dFlex jStart_aCenter">
					<view class="searchIcon imgPublic">
						<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/searchIcon.png" mode="widthFix"></image>
					</view>
					<view class="ipt">
						<input type="text" v-model="keyword" @input='searchKw' placeholder="搜索">
					</view>
				</view>
			</view>
		</view>
		<view class="topContent">
			<!-- <view class="pageBg imgPublic">
				<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/seckill_bg.png" mode="widthFix"></image>
			</view> -->
			<view :class="['content',device=='ios'?'iosPadding':'androidPadding']">
				<view class="endTime dFlex jStart_aCenter">
					<text>距离结束</text>
					<view class="showTime">
						<u-count-down
							:timestamp="calcTime(banners.end_time)" 
							:show-days="true" :show-hours="true" 
							bg-color='#FF4600' color='#ffffff' separator-color='#FF4600' height='42' :separator-size='40' :font-size='30'></u-count-down>
					</view>
				</view>
				<!-- <view class="shopPart" @tap='lookSeckill'>
					<view class="tits dFlex jBetween_aCenter">
						<view class="titImg imgPublic">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/wrt.png" mode="widthFix"></image>
						</view>
						<view class="haveUsers dFlex jEnd_aCenter">
							<view class="userTx dFlex jEnd_aCenter">
								<view class="txOne imgPublic" v-for="(item,index) in banners.top_users_avatar" :key='index' :style='"transform:translateX("+(-index*15)+"rpx)"'>
									<image :src="item.avatar"></image>
								</view>
							</view>
							<text>{{banners.top_users?banners.top_users:'0'}}人已抢</text>
						</view>
					</view>
					<view class="shops">
						<view class="shopOne" v-for="(item,index) in banners.goods_list" :key='index'>
							<view class="shopImg imgPublic dFlex jCenter_aCenter">
								<image :src="item.goods_main_img" mode="widthFix"></image>
							</view>
							<view class='shopInfo'>
								<view class="shopName">{{item.goods_title}}</view>
								<view class="priceTag dFlex jStart_aCenter">
									<view class="miaosha">秒杀价</view>
									<view class="jiang">已降{{(item.goods_price - item.ms_price).toFixed(2)}}元</view>
								</view>
								<view class="tools dFlex jBetween_aEnd">
									<view class="showPrice">￥<text>{{item.ms_price}}</text></view>
								</view>
							</view>
						</view>
					</view>
				</view> -->
				<view class="teamInfo dFlex jStart_aStart">
					<view class="teamImg imgPublic">
						<image v-if='leaderInfo.address_id>0 && leaderInfo.store_imgs' :src="leaderInfo.store_imgs" mode='widthFix'></image>
						<image v-else src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/empty.png" mode="widthFix"></image>
					</view>
					<view class="info">
						<!-- <view class='tz'>{{leaderInfo.nickname}} {{" "+(leaderInfo.mobile?leaderInfo.mobile:leaderInfo.phone)}}</view> -->
						<!-- <view class='tz'>{{leaderInfo.nickname}}</view> -->
						<view class="zt dFlex jStart_aCenter">
							<view class="shop">自提点：{{leaderInfo.address_id>0 && leaderInfo.store_name?leaderInfo.store_name:'暂未填写'}}</view>
							<!-- <view class="time">次日达</view> -->
						</view>
						<view class="ztAdd dFlex jBetween_aCenter">
							<view class="add">提货地址：<text>{{leaderInfo.address_id>0 && leaderInfo.address?leaderInfo.address:'暂未填写'}}</text></view>
							<view class="" @tap='selZiti'>切换</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="shops">
			<!-- <view class="timeSlot dFlex jAround_aCenter">
				<view :class="['timeOne',selAct_time == item.id?'active':'']" v-for="(item,index) in menus" :key='index' @tap='changeFirstMenu(item.id)'>
					<text>{{item.time}}</text>
					<view class="line"></view>
				</view>
			</view>
			<view class="menus">
				<view :class="['menuOne',kindIdx == '-2'?'active':'']" @tap='changeSecondMenu("-2")'>精选</view>
				<view :class="['menuOne',kindIdx == '-1'?'active':'']" @tap='changeSecondMenu("-1")'>
					<view class="menuContent dFlex jCenter_aCenter">
						<view class="menuIcon imgPublic">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/menuTime.png" mode="widthFix"></image>
						</view>
						<text>即将售罄</text>
					</view>
				</view>
				<view :class="['menuOne',kindIdx == index?'active':'']" v-for="(item,index) in kind" :key='index' @tap='changeSecondMenu(index)'>{{item}}</view>
			</view> -->
			<view class="quan dFlex jBetween_aCenter" v-if="cpList.length" @tap='getCpList = true'>
				<view class="quanContent dFlex jStart_aCenter">
					<view class='quanIcon imgPublic'>
						<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/quanIcon.png" mode="widthFix"></image>
					</view>
					<view>领取<text>满{{cpList[0].min_price}}元减{{cpList[0].sub_price}}元</text>活动券</view>
				</view>
				<view class="time dFlex jEnd_aCenter">
					<!-- <text>仅剩00:27:47:09</text> -->
					<view class="rightIcon imgPublic">
						<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/rightIcon.png" mode="widthFix"></image>
					</view>
				</view>
			</view>
			<view class="list" v-if="list.length">
				<view v-for="(item,index) in list" :key='index'>
					<view :class="['shopOne','dFlex','jStart_aStart',item2.hui?'hui':'']" v-for="(item2,index2) in item.goods_list" :key='index2' @tap.stop='lookDetail(item2.goods_id)' >
						<view class="shopImg imgPublic">
							<image :src="item2.goods_main_img"></image>
							<view class="noHave imgPublic" v-if="item.is_xg=='1' && item2.user_residue_num == 0">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/noHave.png" mode="widthFix"></image>
							</view>
							<!-- v-if='user.auth_status == "2"' -->
							<view class='yjCount dFlex jAround_aCenter' >
								<view class='showYJ'>佣</view>
								<text>{{(parseFloat(item2.ms_price) * parseFloat(item2.service_rate) / 100).toFixed(2)}}</text>
							</view>
						</view>
						<view class="shopInfo">
							<view class="shopName">{{item2.goods_title}}</view>
							<view class="bar dFlex jStart_aCenter" v-if="status == '1'"> 
								<view class="progress">
									<view class="current" :style="'width:'+item2.rate+'%'"></view>
								</view>
								<text v-if="item2.startFlag && status=='1'">刚刚开抢</text>
							</view>
							<view class='spec'>规格：{{item2.goods_default_attr?item2.goods_default_attr:'默认规格'}}</view>
							<view class="config">
								<view class="priceTag dFlex jStart_aCenter">
									<view class="miaosha">秒杀价</view>
									<view class="jiang">已降{{(item2.goods_price - item2.ms_price).toFixed(2)}}元</view>
									<view class="xgNum" v-if='item.is_xg=="1"'>限购{{item2.xg_num}}份</view>
								</view>
								<view class="tools dFlex jBetween_aEnd">
									<view class="showPrice">￥<text>{{item2.ms_price}}</text></view>
									<view class="count dFlex jEnd_aCenter" v-if="seckillStatus == '1' && ( (item.is_xg=='1' && item2.user_residue_num > 0) || item.is_xg!='1' )">
										<!-- <u-number-box bg-color='#ffffff' v-model="item2.num" :max='item.is_xg=="1"?item2.user_residue_num:item2.ms_stock' size='24' @change='changeCount($event,index)'></u-number-box> -->
										<view class='smallBtn imgPublic' @tap.stop='changeCount(2,index2)'>
											<image src='https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/jian.png' mode='widthFix'></image>
										</view>
										<view class='smallIpt'>
											<input type="number" v-model='item2.count' disabled :max='item.is_xg=="1"?item2.user_residue_num:item2.ms_stock'>
										</view>
										<view class='smallBtn imgPublic' @tap.stop='changeCount(1,index2)'>
											<image src='https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/jia.png' mode='widthFix'></image>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="list empty imgPublic" v-else>
				<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/empty.png" mode="widthFix"></image>
			</view>
			<view class="seat"></view>
			<!-- 已开始活动底部按钮 -->
			<view :class="['bottomBtn',device == 'ios'?'ios_safe':'','dFlex','jBetween_aCenter']" v-if='seckillStatus=="1"'>
				<view class="opBtns dFlex jStart_aCenter">
					<view class="smallMenu" @tap.stop='back'>
						<view class="menuIcon">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/seckill_home.png" mode="widthFix"></image>
						</view>
						<text>首页</text>
					</view>
					<button open-type="share" class="smallMenu">
						<view class="menuIcon">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/seckill_share.png" mode="widthFix"></image>
						</view>
						<text>分享</text>
					</button>
					<!-- <view class="smallMenu">
						<view class="menuIcon">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/seckill_car.png" mode="widthFix"></image>
						</view>
						<text>购物车</text>
						<view class="count" v-if="carnum>0">{{carnum}}</view>
					</view> -->
				</view>
				<view class="tj dFlex jEnd_aCenter">
					<view class="allCount">
						<view class="resultPrice">共{{carnum}}件{{' '}}合计:<text>￥{{allPrice?parseFloat((allPrice - cpCount).toFixed(2)):'0.00'}}</text></view>
						<view class="line2" v-if="coupon.length" @tap.stop='changeCouponFlag'>共优惠<text>￥{{cpCount}}</text></view>
					</view>
					<view class="payBtn" @tap.stop='pay'>去支付</view>
				</view>
			</view>
			<!-- 未开始活动底部按钮 -->
			<view :class="['bottomBtn',device == 'ios'?'ios_safe':'','dFlex','jStart_aCenter']" v-if='seckillStatus=="2"'>
				<view class="tj dFlex jCenter_aCenter unStart">
					<text class="startTxt">倒计时：</text>
					<u-count-down
						:timestamp="calcTime(allAct[selAct_idx].start_time)" 
						:show-days="true" :show-hours="true" 
						bg-color='#FB5D02' color='#ffffff' separator-color='#FB5D02' height='42' :separator-size='40' :font-size='30'></u-count-down>
					<text class="startTxt">开启秒杀</text>
				</view>
			</view>
		</view>
		<!-- 分享 -->
		<view class="zz dFlex flexDirection jCenter_aCenter zz2" v-if='postFlag'>
			<canvas canvas-id="myCanvas" id="myCanvas" :style="'width:80%;height:'+canvasHeight+'px;'"></canvas>
			<view class="seat"></view>
			<view :class="['opBtns',device == 'ios'?'ios_sureBtn':'']">
				<view class='toast'>立即分享</view>
				<view class='btns dFlex jAround_aCenter'>
					<button open-type="share" class="opBtnOne">
						<view class="btnImg imgPublic">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/weixin.png" mode="widthFix"></image>
						</view>
						<text>微信好友</text>
					</button>
					<view class="opBtnOne" @tap.stop='saveImg'>
						<view class="btnImg imgPublic">
							<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/shareIcon4.png" mode="widthFix"></image>
						</view>
						<text>保存图片</text>
					</view>
				</view>
				<view class='close' @tap.stop='postFlag = false'>关闭</view>
			</view>
		</view>
		<!-- 优惠券领取弹窗 -->
		<view class="zz dFlex flexDirection jEnd_aCenter" v-if="getCpList" @tap.stop='getCpList = false'>
			<view class='coupon'>
				<view class="titles dFlex jCenter_aCenter">
					<view class="line"></view>
					<view class="tit">秒杀优惠券</view>
					<view class="line"></view>
				</view>
				<view class="tools dFlex jCenter_aCenter">
					<view>每场限用一张优惠券，</view>
					<view class="dFlex jCenter_aCenter">
						<text>距离本场结束</text>
						<view><u-count-down
						:timestamp="calcTime(allAct[selAct_idx].end_time)" 
						:show-days="true" :show-hours="true" 
						bg-color='transparent' color='#FC3C11' separator-color='#FC3C11' height='42' :separator-size='20' :font-size='30'></u-count-down></view>
					</view>
				</view>
				<view class="qlist2">
					<view class="qOne" v-for="(item,index) in cpList" :key='index'>
						<view class="cpMain">
							<view class="cpBgImg imgPublic">
								<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/qBg_img.png" mode="widthFix"></image>
							</view>
							<view class="cpContent dFlex jBetween_aCenter">
								<view class="contentLeft">
									<view class="tag" v-if="item.type == '0'">无门槛券</view>
									<view class="tag" v-if="item.type == '1'">满减券</view>
									<view class="tag" v-if="item.type == '2'">活动券</view>
									<view class="tag" v-if="item.type == '3'">立减券</view>
									<view class="tag" v-if="item.type == '4'">折扣券</view>
									<view class="content dFlex jStart_aStart">
										<view class="shopImg imgPublic" v-if="cover_img">
											<image :src="item.cover_img" mode="widthFix"></image>
										</view>
										<view class="cpDetail">
											<view class="toast" v-if="item.appoint_type == '2'">仅指定商品使用</view>
											<view class="cpName">{{item.title}}</view>
											<view class="expbtn dFlex jStart_aCenter">
												<view class="progress">
													<view class="injoin" :style="'width:'+item.haveGet+'%'"></view>
												</view>
												<text>券已领取{{item.haveGet}}%</text>
											</view>
										</view>
									</view>
								</view>
								<view class="contentRight dFlex flexDirection jCenter_aCenter">
									<view class="cpCount" v-if="item.type == '4'"><text>{{item.discount}}</text>折</view>
									<view class="cpCount" v-if="item.type != '4'">￥<text>{{item.sub_price}}</text></view>
									<view class="condition" v-if="item.type != '4'">满{{item.min_price}}元可用</view>
									<view class="useBtn" @tap.stop='getCoupon(item.id)'>立即领取</view>
								</view>
							</view>
						</view> 
					</view>
				</view>
			</view>
		</view>
		<!-- 优惠券选择弹窗 -->
		<view class="zz dFlex flexDirection jEnd_aCenter" v-if="couponFlag">
			<view class='coupon' style="padding-bottom: 80px;">
				<view class="titles dFlex jCenter_aCenter">
					<view class="line"></view>
					<view class="tit">优惠券</view>
					<view class="line"></view>
				</view>
				<view class="tools dFlex jBetween_aCenter">
					<view class="count">可用优惠券({{coupon.length}})</view>
					<!-- <view class="explain">优惠券说明</view> -->
				</view>
				<view class="qList">
					<view class="cpOne" v-for="(item,index) in coupon" :key='index' @tap.stop='change_sekStatus(item)'>
						<view class="cpMain">
							<view class="cpBgImg imgPublic">
								<image v-if="!item.canUse" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/haveUse.png" mode="widthFix"></image>
								<image v-if="item.canUse" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/noUse.png" mode="widthFix"></image>
								<view class="statusIcon imgPublic" v-if="item.canUse">
									<image v-if="!item.selFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/unsel.png" mode="widthFix"></image>
									<image v-if="item.selFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/sel2.png" mode="widthFix"></image>
								</view>
							</view>
							<view class="cpContent dFlex jBetween_aCenter">
								<view class="contentLeft">
									<view class="tag" v-if="item.type == '0'">无门槛券</view>
									<view class="tag" v-if="item.type == '1'">满减券</view>
									<view class="tag" v-if="item.type == '2'">活动券</view>
									<view class="tag" v-if="item.type == '3'">立减券</view>
									<view class="tag" v-if="item.type == '4'">折扣券</view>
									<view class="content dFlex jStart_aStart">
										<!-- <view class="shopImg imgPublic">
											<image src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/logo.png" mode="widthFix"></image>
										</view> -->
										<view class="cpDetail">
											<view class="toast" v-if="item.type == 3">仅限指定商品使用</view>
											<view class="cpName">{{item.title}}</view>
											<view class="time">{{item.start_time_text.substring(0,item.start_time_text.length-3)}}至{{item.end_time_text.substring(0,item.start_time_text.length-3)}}</view>
											<view class="expbtn dFlex jStart_aCenter" @tap.stop='changeRuleFlag(item)'>
												<text>详细信息</text>
												<view class="exBtn imgPublic">
													<image v-if="item.ruleFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/open.png" mode="widthFix"></image>
													<image v-if="!item.ruleFlag" src="https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/cMini/close.png" mode="widthFix"></image>
												</view>
											</view>
										</view>
									</view>
								</view>
								<view class="contentRight dFlex flexDirection jCenter_aCenter">
									<view class="cpCount" v-if="item.type != '4'">￥<text>{{item.sub_price}}</text></view>
									<view class="cpCount" v-if="item.type == '4'"><text>{{item.discount}}</text>折</view>
									<view class="condition" v-if="item.type != '3' && item.type != '0' && item.type != '4'">满{{item.min_price}}元可用</view>
									<!-- <view class="useBtn">立即使用</view> -->
								</view>
							</view>
						</view> 
						<view class="explain" v-if="item.ruleFlag">
							<view class="line">{{item.rule}}</view>
						</view>
					</view>
				</view>
				<view class="btns dFlex jCenter_aCenter" @tap.stop='couponFlag = false'>
					<view class="btn">可减{{cpCount}}元，去结算</view>
				</view>
			</view>
		</view>
		
		<login :loginStatus='loginStatus' @opFlag='closeLogin' :code='code' :status='1'></login>
		<Address :store='storeOne' :count='count' @opFlag='closeAdd' @selLine='selLine' @changeAdd='selZiti'></Address>
	</view>
</template>
<script>
	import login from '@/components/login.vue';
	import address from '@/components/address.vue';
	export default{
		components: {
			login,
			address
		},
		data(){
			return{
				user:{auth_status:'-1'},
				canvasHeight:"",
				postFlag:false,
				shareCode:'',
				postImg:'',
				adv:'',
				
				is_limit:'',// 0 长期  1 短期
				seckillStatus:'',// 0 已结束  1 进行中  2 未开始
				
				loginStatus:true,
				code:'',
				
				share:'',// 1 推品端跳转分享
				msid:'',//秒杀id
				mobile:'',
				
				device:getApp().globalData.platform,
				// pagePad:0,
				leaderInfo:{},
				allAct:[],//当天所有的秒杀活动
				list:[],
				oldList:[],
				menus:[],
				kind:[],
				kindIdx:'-2',// -2 精选  -1 即将售罄
				
				datas:{},
				// 广告位的数据
				banners:{},
				// 当前选中的时间和对应的活动 id
				selAct_time:'',
				selAct_idx:'',//当前选中的活动的下标
				
				carnum:0,
				allPrice:0,
				link:'',
				
				// 最近的门店
				storeOne:{},
				count:0,//弹窗提示限制1次
				
				// 优惠券使用列表
				coupon:[],
				couponFlag:false,
				cpCount:0.00,
				selcp:[],
				//优惠券领取列表
				getCpList:false,
				cpList:[],
				
				fullDown:false,
				
				wallet:'',
				// 搜索关键字
				keyword:'',
			}
		},
		onLoad(e) {
			console.log(e);
			this.share = e.share?e.share:'';
			if(e.scene){
				// 识别 扫描二维码
				let canshu = decodeURIComponent(e.scene)?decodeURIComponent(e.scene):'';
				this.link = canshu;
				let csArr = canshu.split('&');
				this.msid = csArr[0].split('=')[1];
				this.mobile = csArr[1].split('=')[1];
				uni.setStorageSync('tjr_mobile',this.mobile);
			}else{
				this.link = this.tool.objToUrl(e);
			}
			if(this.share == '1'){
				this.msid = e.msid;
				this.mobile = e.mobile;
				uni.setStorageSync('tjr_mobile',e.mobile);
			}else if(!this.share){
				this.msid = e.msid;
				if(e.shareId){
					uni.setStorageSync('shareInfo',{
						time:new Date().getTime(),
						id:'',
						shareId:e.shareId
					});
				}
				if(e.mobile){
					this.mobile = e.mobile;
					uni.setStorageSync('tjr_mobile',e.mobile);
				}else{
					this.mobile = uni.getStorageSync('tjr_mobile');
				}
			}
			uni.getLocation({
				success: (locate) => {
					if(locate.errMsg == 'getLocation:ok'){
						getApp().globalData.lat = locate.latitude;
						getApp().globalData.lng = locate.longitude;
					}
				},
				fail:(err)=>{
					uni.showToast({
						title:'定位信息获取失败',
						icon:"none"
					})
				},
				complete: () => {
					if(this.share){
						this.initCode();
					}
					this.page = 1;
					this.carnum = 0;
					this.allPrice = '';
					
					this.initList();
					if(uni.getStorageSync('user_level') == '2'){//团长
						// 判断团长有没有设置地址
						this.getLeaderAdd();
					}else{//普通用户
						this.initLeaderInfo();
					}
				}
			})
		},
		onShow(){
			if(this.leaderInfo.address_id){
				this.$forceUpdate();
			}
			if(!uni.getStorageSync('uToken')){
				wx.login({
					success:(login)=>{
						this.code = login.code;
					},
					fail:(err)=>{
						console.log(err);
					}
				})
			}else{
				this.initwallet();
			}
			/* if(this.device == 'ios'){
				this.pagePad = uni.getSystemInfoSync().statusBarHeight + 120;
			}else{
				this.pagePad = uni.getSystemInfoSync().statusBarHeight + 114;
			} */
		},
		onShareAppMessage() {
			this.tool.monitor(this.link);
			let share = {}
			if(!this.share){
				share.title = this.datas.title;
				share.path = '/seller/seckill?msid='+this.msid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = this.datas.pt_img;
				share.desc = '';
			}else{
				share.title = this.datas.share_words?this.datas.share_words:this.datas.title;
				share.path = '/seller/seckill?msid='+this.msid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = this.datas.pt_img;
				share.desc = '';
			}
			return share;
		},
		onShareTimeline() {
			this.tool.monitor(this.link);
			let share = {}
			if(!this.share){
				share.title = this.datas.title;
				share.path = '/seller/seckill?msid='+this.msid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = 'https://zl-tuangou.oss-cn-qingdao.aliyuncs.com/'+this.datas.cover_img;
				share.desc = '';
			}else{
				share.title = this.datas.share_words?this.datas.share_words:this.datas.title;
				share.path = '/seller/seckill?msid='+this.msid+"&mobile="+this.mobile+"&shareId="+(uni.getStorageSync('uId')?uni.getStorageSync('uId'):"");
				share.imageUrl = this.shareCode?this.shareCode:this.adv;
				share.desc = '';
			}
			return share;
		},
		methods:{
			// 钱包余额
			initwallet(){
				this.tool.getData('/api/user/info',{},'',this).then(res=>{
					if(res){
						this.user = res;
						this.wallet = res.vip_rechage_balance;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 修改优惠券开关
			changeCouponFlag(){
				this.couponFlag = !this.couponFlag;
				if(this.couponFlag && this.carnum > 0){
					this.coupon.map((item,index)=>{
						if(item.min_price > this.allPrice){
							item.canUse = false;
						}else{
							item.canUse = true;
						}
					})
				}
			},
			// 修改优惠券使用状态
			change_sekStatus(line){
				if(line.canUse){
					this.coupon.map((item,index)=>{
						if(item.id != line.id){
							item.selFlag = false;
						}
					})
					line.selFlag = !line.selFlag;
					this.calcCoupon_Price();
				}
			},
			// 计算选中的优惠券的金额
			calcCoupon_Price(){
				this.cpCount = 0;
				this.selcp = [];//选中的优惠券
				this.coupon.map((item,index)=>{
					if(item.selFlag){
						this.selcp.push(item);
					}
				})
				if(this.selcp.length){
					this.selcp.map((item,index)=>{
						this.cpCount = parseFloat(this.cpCount) + parseFloat(item.sub_price);
					})
				}else{
					this.cpCount = 0;
				}
			},
			// 修改使用规则开关
			changeRuleFlag(line){
				line.ruleFlag = !line.ruleFlag;
			},
			// 获取团长地址
			getLeaderAdd(){
				this.tool.getData('/api/user/info',{},'',this).then(res=>{
					if(res){
						if(res.address_id){//设置了地址
							this.leaderInfo = {
								address:res.address,
								address_detail:res.address_detail?res.address_detail:'',
								address_id:res.address_id,
								mobile:res.mobile?res.mobile:'',
								phone:res.phone?res.phone:'',
								nickname:res.nickname,
								id:res.id,
								store_imgs:res.store_imgs,
								store_name:res.store_name,
							}
						}else{//没设置地址 获取列表第一个
							this.initAddList();
						}
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			initAddList(){
				this.tool.getData('/api/mall/returnTeamList',{
					lat:getApp().globalData.lat,
					lng:getApp().globalData.lng,
					keyword:"",
				}).then(res=>{
					if(res && res.length){
						if(uni.getStorageSync('user_level') != '2'){
							this.storeOne = this.count == '0'?res[0]:{};
						}else{
							/* uni.showModal({
								content:'当前团长未设置自提点，是否现在设置',
								success: (op) => {
									if(op.confirm){
										uni.navigateTo({
											url:"/my/tmAddress"
										})
									}
								},
								fail:(err)=>{
									
								}
							}) */
						}
						this.leaderInfo = {
							address:res[0].address,
							address_detail:res[0].address_detail,
							address_id:res[0].id,
							mobile:res[0].mobile?res[0].mobile:'',
							phone:res[0].phone?res[0].phone:'',
							nickname:res[0].receiver,
							id:res[0].user_id,
							store_imgs:res[0].store_imgs,
							store_name:res[0].store_name,
						}
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 选择该地址
			selLine(data){
				this.leaderInfo = this.storeOne;
				this.count = 1;
			},
			// 关闭弹窗
			closeAdd(data){
				this.initAddList();
				this.count = data;
			},
			// 优惠券列表
			initCoupon(){
				this.tool.getData('/api/mall/getUseCoupon',{
					source:'2',
					source_id:this.msid?this.msid:'',
				}).then(res=>{
					// console.log(res);
					if(res && res.length){
						res.map((item,index)=>{
							item.selFlag = false;
							item.ruleFlag = false;
							item.canUse = false;
						})
						// this.cpList = res;
						this.coupon = res;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			initLeaderInfo(){
				this.tool.getData('/api/miaosha/getMiaoshaInfoToc',{
					lat:getApp().globalData.lat,
					lng:getApp().globalData.lng,
					tjr_mobile:this.mobile,
				}).then(res=>{
					// console.log(res);
					if(res){
						if(res.address_id == '0'){
							this.initAddList();
						}else{
							this.storeOne = res;
						}
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 列表
			initList(){
				this.tool.getData('/api/miaosha/getMiaoshaListNew',{
					ms_id:this.msid,
				}).then(res=>{
					console.log('活动详情');
					console.log(res);
					if(res && res.length){
						this.allAct = res;
						res.map((item,index)=>{
							if(item.is_top != '1'){
								if(item.start_time * 1000 <= new Date().getTime() && new Date().getTime() < item.end_time * 1000){
									this.selAct_idx = index;
									this.selAct_time = item.id;
									this.seckillStatus = '1';
									item.goods_list.map((item2,index2)=>{
										item2.count = 0;
										item2.gt_str = item2.gt_str?item2.gt_str.split(','):[];
									})
									this.kind = item.goods_types && item.goods_types.length?item.goods_types:[];
									this.msid = item.id;
									this.list.push(item);
									this.oldList = JSON.parse(JSON.stringify(this.list[0].goods_list));
									if(item.coupon_list && item.coupon_list.length){
										item.coupon_list.map((item2,index2)=>{
											item2.haveGet = (((item2.total_count - item2.residue_count) / item2.total_count) * 100).toFixed(2);
										})
									}
									this.cpList = item.coupon_list && item.coupon_list.length?item.coupon_list:[];
									this.initCoupon();
								}
								// 获取开始时间
								let startTime = this.tool.timestampToTime(item.start_time * 1000).split(' ')[1].split(':')[0]+":"+this.tool.timestampToTime(item.start_time * 1000).split(' ')[1].split(':')[1];
								this.menus.push({
									id:item.id,
									time:startTime+'场',
								})
							}
							this.banners = item;
							console.log(this.banners);
						})
					}
				}).catch(err=>{
					console.log(err);
				})
			}, 
			// 支付
			pay(){
				if(!uni.getStorageSync('uToken')){
					this.loginStatus = false;
					return;
				}
				let goods_list = [];
				this.list[0].goods_list.map((item,index)=>{
					if(item.count>0){
						goods_list.push(item);
						/* goods_list.push({
							goods_id:item.goods_id,
							num:item.num,
							goods_attr_id:item.goods_attr_id,
						}) */
					}
				})
				if(!goods_list.length){
					uni.showToast({
						title:'请至少添加一件商品',
						icon:"none"
					})
					return;
				}
				uni.navigateTo({
					url:'/my/activeBefore_order?msid='+this.msid+'&shops='+JSON.stringify(goods_list)+'&leaderInfo='+(this.leaderInfo.address_id ? JSON.stringify(this.leaderInfo) : ''),
					fail:(err)=>{
						console.log(err);
					}
				})
				return
				if(!this.leaderInfo.address_id){
					uni.showToast({
						title:'请选择一个自提地址',
						icon:"none"
					})
					return;
				}
				let coupon = '';
				if(this.coupon.length){
					this.coupon.map((item,index)=>{
						coupon = index == this.coupon.length-1?coupon + item.id:coupon + item.id+',';
					})
				}
				uni.showActionSheet({
					itemList:['微信支付','余额支付'],
					success: (op) => {
						let paytype = op.tapIndex == 0?'wxpay':'balance';
						if(paytype == 'balance' && this.wallet < this.allPrice){
							uni.showModal({
								title:'余额不足 是否充值',
								success:(op)=>{
									if(op.confirm){
										uni.navigateTo({
											url:'/my/recharge'
										})
									}
								},
							})
							return;
						}
						this.tool.getData('/api/mall/createOrderByMiaosha',{
							ms_id:this.msid,
							tjr_mobile:this.mobile,
							address_id:this.leaderInfo.address_id,
							goods_list:JSON.stringify(goods_list),
							service_user_id:this.leaderInfo.id,
							coupon:coupon,
							paytype:paytype,
						}).then(res=>{
							// console.log(res);
							if(res){
								this.tool.getData('/api/mall/orderPay',{
									oid:res.id
								}).then(payInfo=>{
									if(paytype == 'wxpay'){
										uni.requestPayment({
											provider:'wxpay',
											timeStamp:payInfo.info.timeStamp,
											nonceStr:payInfo.info.nonceStr,
											package:payInfo.info.package,
											signType:payInfo.info.signType,
											paySign:payInfo.info.paySign,
											success: (pay) => {
												// 跳支付成功
												uni.showToast({
													title:'订单支付成功',
													icon:"success"
												})
												setTimeout(()=>{
													uni.switchTab({
														url:"/pages/active"
													})
												},1650)
											},
											fail:(err)=>{
												console.log(err);
												uni.showToast({
													title:'取消支付',
													icon:"none"
												})
											}
										})
									}else{
										uni.showToast({
											title:'订单支付成功',
											icon:"success"
										})
										setTimeout(()=>{
											uni.switchTab({
												url:"/pages/active"
											})
										},1650)
									}
								}).catch(err=>{
									console.log(err);
								})
							}
						}).catch(err=>{
							console.log(err);
						})
					},
					fail:(err)=>{
						console.log(err);
					}
				})
			},
			// 修改数量
			changeCount(status,idx){
				let line = this.list[0].goods_list[idx];
				if(this.list[0].is_xg == '1'){//秒杀限购
					if(status == '1'){
						line.count++;
						if(line.count>line.user_residue_num){
							uni.showToast({
								title:'该商品限购剩余：'+line.user_residue_num+'份',
								icon:"none"
							})
							line.count = line.user_residue_num;
						}
					}else{
						line.count--;
						if(line.count<0){
							line.count = 0;
						}
					}
				}else{//秒杀不限购
					if(status == '1'){
						line.count++;
						if(line.count>line.ms_stock){
							line.count = line.ms_stock;
						}
					}else{
						line.count--;
						if(line.count<0){
							line.count = 0;
						}
					}
				}
				this.calcPrice();
			},
			// 计算显示价格和数量
			calcPrice(){
				this.carnum = 0;
				this.allPrice = 0;
				this.list[0].goods_list.map((item,index)=>{
					this.carnum = this.carnum+item.count;
					let priceOne = item.ms_price * item.count;
					this.allPrice = this.allPrice+priceOne;
				})
				/* if(this.carnum > 0 && this.allPrice < this.money_limit){
					this.fullDown = true;
					setTimeout(()=>{
						const query = uni.createSelectorQuery().in(this);
						query.select('.bottomBtn').boundingClientRect(data => {
							console.log(data);
							this.btnsHeight = data.height;
						}).exec();
					},500)
				}else{
					this.fullDown = false;
				} */
			},
			// 查看商品详情
			lookDetail(id){
				uni.navigateTo({
					url:'./shopDetail?actType=2&actId='+this.msid+'&id='+id
				})
			},
			// 切换一级菜单
			changeFirstMenu(id){
				if(id != this.selAct_time){//不是当前显示的活动
					this.list = [];
					this.kind = [];
					this.cpList = [];
					this.coupon = [];
					let idx = this.tool.getIdx(this.allAct,'id',id);
					let line = this.allAct[idx];
					
					this.selAct_idx = idx;
					this.selAct_time = line.id;
					line.goods_list.map((item2,index2)=>{
						item2.count = 0;
					})
					this.kind = line.goods_types.length?line.goods_types:[];
					this.msid = line.id;
					this.list.push(line);
					this.oldList = JSON.parse(JSON.stringify(this.list[0].goods_list));
					if(line.coupon_list.length){
						line.coupon_list.map((item2,index2)=>{
							item2.haveGet = (((item2.total_count - item2.residue_count) / item2.total_count) * 100).toFixed(2);
						})
					}
					this.cpList = line.coupon_list.length?line.coupon_list:[];
					this.initCoupon();
					
					if(line.start_time * 1000 <= new Date().getTime() && new Date().getTime() < line.end_time * 1000){
						this.seckillStatus = '1';
					}else if(new Date().getTime() < line.start_time * 1000){//未开始
						this.seckillStatus = '2';
					}else if(new Date().getTime() > line.end_time * 1000){//已结束
						this.seckillStatus = '0';
					}
					this.carnum = 0;
					this.allPrice = 0;
					this.cpCount = 0.00,
					this.selcp = [];
					this.coupon.map((item,index)=>{
						item.selFlag = false;
					})
				}
			},
			// 切换二级菜单
			changeSecondMenu(status){
				this.kindIdx = status;
				let keyword = status >= 0?this.kind[status]:status == '-2'?'精选':'即将售罄';
				if(keyword == '即将售罄'){
					this.list[0].goods_list = JSON.parse(JSON.stringify(this.oldList));
					this.list[0].goods_list.sort(this.tool.sortBy('ms_stock'));
				}else if(keyword == '精选'){
					this.list[0].goods_list = JSON.parse(JSON.stringify(this.oldList));
				}else{
					this.list[0].goods_list = [];
					this.oldList.map((item,index)=>{
						let idx = item.gt_str.indexOf(keyword);
						if(idx != '-1'){
							this.list[0].goods_list.push(item);
						}
					})
				}
				this.carnum = 0;
				this.allPrice = 0;
				this.cpCount = 0.00,
				this.selcp = [];
				this.coupon.map((item,index)=>{
					item.selFlag = false;
				})
			},
			// 领取优惠券
			getCoupon(id){
				this.tool.getData('/api/coupon/getCoupon',{
					coupon_id:id
				}).then(res=>{
					console.log(res);
					if(res){
						uni.showToast({
							title:"成功领取",
							icon:"success"
						})
						this.initCoupon();
					}
				})
			},
			// 关键词搜索
			searchKw(e){
				if(e.detail.value){
					this.list[0].goods_list = [];
					this.oldList.map((item,index)=>{
						if(item.goods_title.indexOf(e.detail.value) != '-1'){
							this.list[0].goods_list.push(item);
						}
					})
				}else{
					this.list[0].goods_list = JSON.parse(JSON.stringify(this.oldList));
				}
			},
			// 查看banner位置的秒杀活动
			lookSeckill(){
				if(!uni.getStorageSync('uToken')){
					this.loginStatus = false;
					return;
				}
				uni.navigateTo({
					url:'./seckillTwo?msid='+this.banners.id,
				})
			},
			// 选择自提点
			selZiti(){
				this.count = 1;
				uni.navigateTo({
					url:'../my/ziti?msid='+this.msid+'&leaderInfo='+JSON.stringify(this.leaderInfo),
				})
			},
			// 返回上一页
			back(){
				uni.navigateBack({
					delta:1,
					fail: () => {
						uni.switchTab({
							url:'/pages/active'
						})
					}
				})
				/* uni.switchTab({
					url:"/pages/seller"
				}) */
			},
			// 关闭登录
			closeLogin(data){
				this.getLeaderAdd();
				this.loginStatus = data;
				this.initwallet();
			},
			// 保存图片
			saveImg(){
				this.createImg();
			},
			// 分享二维码
			initCode(){
				this.tool.getData('/api/miaosha/getMiaoshaQrcodeNew',{
					ms_id:this.msid,
					tjr_mobile:this.mobile,
				}).then(res=>{
					if(res){
						this.postImg = res.qrcode;
						this.shareCode = res.cover_img;
						this.postFlag = true;
					}
				}).catch(err=>{
					console.log(err);
				})
			},
			// 生成图片
			createImg(){
				uni.showLoading({
					title:'制作中...'
				})
				let thumb = this.datas.share_img;
				let canvasWidth = uni.getSystemInfoSync().windowWidth * 0.8; 
				let ctx = uni.createCanvasContext('myCanvas', this);
				uni.getImageInfo({
					src:this.datas.share_img,
					success: (post) => {
						let rate = post.width / post.height;
						this.canvasHeight = canvasWidth / rate;
						setTimeout(()=>{
							// 填充背景色，白色
							ctx.setFillStyle('#FB5D02'); // 默认白色
							ctx.fillRect(0, 0,canvasWidth,this.canvasHeight); // fillRect(x,y,宽度，高度)
							ctx.drawImage(post.path,0,0,canvasWidth,this.canvasHeight);
							// 头像昵称
							uni.downloadFile({
								url:this.leaderInfo.avatar,
								success: (tx) => {
									let txFile = tx.tempFilePath;
									this.tool.circleImgOne(ctx,txFile,12,8,12);
									// 昵称
									let nickname = this.leaderInfo.nickname;
									ctx.setFontSize(13) // 字号
									ctx.setFillStyle('#ffffff') // 字体颜色
									ctx.fillText(nickname,40,20);//绘制截取部分
									// 提示文字1
									let toast1 = '我觉得这些产品很棒，推荐给你！';
									ctx.setFontSize(12) // 字号
									ctx.setFillStyle('#ffffff') // 字体颜色
									ctx.fillText(toast1,40,35);//绘制截取部分
									uni.hideLoading();
									// 二维码
									uni.showLoading({
										title:'正在为您生成专属分享码...'
									})
									this.tool.base64Save(this.postImg).then(code=>{
										ctx.drawImage(code,50,this.canvasHeight-67,50,50);
										ctx.draw(true,()=>{
											setTimeout(()=>{
												uni.canvasToTempFilePath({ // 保存canvas为图片
													canvasId: 'myCanvas',
													quality: 1,
													width:canvasWidth,
													height:this.canvasHeight,
													destWidth:canvasWidth * 3,
													destHeight:this.canvasHeight * 3,
													complete: (res)=> {
														uni.hideLoading();
														if(res.tempFilePath){
															uni.saveImageToPhotosAlbum({
																filePath:res.tempFilePath,
																success: () => {
																	uni.showToast({
																		title:"图片已保存",
																		icon:'success'
																	})
																	this.tool.monitor(this.link);
																},
																fail:(err)=>{
																	console.log(err);
																	uni.showToast({
																		title:'图片保存失败',
																		icon:'none'
																	})
																}
															})
														}
													},
												},this) // 这里是新增的this，只有在微信小程序中需要加入，不然会报错
											},500)
										})
									}).catch(err=>{
										console.log(err);
									})
								},
								fail:(err)=>{
									console.log(err);
								},
								complete: () => {}
							})
						},500)
					},
					fail:(err)=>{
						uni.showToast({
							title:'图片信息获取失败',
							icon:"none"
						})
					},
					complete: () => {
						
					}
				})
			},
			// 计算剩余时间
			calcTime(time){
				return (time * 1000 - new Date().getTime()) / 1000;
			},
		}
	}
</script>
<style lang="scss">
	page{
		background: linear-gradient(133deg, #FCB900 0%, #FF4600 100%);
	}
	.zz{
		.coupon{
			color: #333333;
			width: 100%;
			border-top-left-radius: 40rpx;
			border-top-right-radius: 40rpx;
			background: white;
			max-height: 80%;
			position: relative;
			overflow: auto;
			padding-bottom: 20px;
			box-sizing: border-box;
			.btns{
				width: 100%;
				padding: 20rpx 0;
				border-top: 1px solid #D8D8D8;
				position: fixed;
				left: 0;
				bottom: 0;
				background: white;
				.btn{
					width: 74.4%;
					text-align: center;
					color: white;
					border-radius: 50px;
					background: linear-gradient(180deg, #FC9700 0%, #FF5000 100%);
					padding: 24rpx 0;
					font-size: 16px;
				}
			}
			.qlist2{
				width: 100%;
				padding: 0 24rpx;
				box-sizing:border-box;
				.qOne{
					width: 100%;
					background: white;
					border-radius: 20rpx;
					box-sizing: border-box;
					overflow: hidden;
					margin-bottom: 20rpx;
					.cpMain{
						width: 100%;
						position: relative;
						.cpBgImg{
							width: 100%;
							position: relative;
							.statusIcon{
								width: 130rpx;
								position: absolute;
								top: 0;
								right: 0;
							}
						}
						.cpContent{
							width: 100%;
							height: 100%;
							position: absolute;
							top: 0;
							left: 0;
							.contentLeft{
								width: 67%;
								height: 100%;
								padding:12rpx 24rpx;
								box-sizing: border-box;
								.content{
									width: 100%;
									.cpDetail{
										flex: 1;
										min-width: calc(100% - 70px);
										.toast{
											color: #666666;
											font-size: 12px;
											margin-bottom: 4rpx;
										}
										.cpName{
											margin-bottom: 4rpx;
											width: 100%;
											overflow: hidden;
											text-overflow: ellipsis;
											white-space: nowrap;
											font-size: 15px;
											font-weight: bold;
										}
										.time{
											color: #666666;
											font-size: 12px;
											margin-bottom: 12rpx;
										}
										.expbtn{
											color: #999999;
											font-size: 12px;
											width: 100%;
											.progress{
												width: 40%;
												height:12rpx;
												margin-right: 12rpx;
												background: #EDEDED;
												border-radius: 50px;
												.injoin{
													width: 10%;
													border-radius: 50px;
													height: 100%;
													background: #FC3C11;
												}
											}
										}
									}
									.shopImg{
										width: 128rpx;
										height: 128rpx;
										margin-right:12rpx;
										position:relative;
										image{
											width: 100%;
											height: 100%;
											border-radius: 20rpx;
										}
									}
								}
								.tag{
									font-size: 10px;
									padding: 2px 18rpx;
									color: #FD5605;
									background: #FFF0E8;
									margin-bottom: 8rpx;
									width: max-content; 
									border-radius: 8px;
								}
							}
							.contentRight{
								width: 33%;
								height: 100%;
								padding: 24rpx;
								box-sizing: border-box;
								color: #FC3C11;
								.useBtn{
									width: max-content;
									padding: 10rpx 16rpx;
									border-radius: 50px;
									font-size: 12px;
									color: white;
									background: linear-gradient(270deg, #FC3C11 0%, #FD7005 100%);
								}
								.condition{
									font-size: 12px;
									margin-bottom: 10rpx;
								}
								.cpCount{
									font-size: 17px;
									font-weight: bolder;
									text{
										font-size: 20px;
									}
								}
							}
						}
					}
				}
			}
			.qList{
				width: 100%;
				padding: 0 24rpx;
				box-sizing: border-box;
				.cpOne{
					width: 100%;
					background: white;
					border-radius: 20rpx;
					box-sizing: border-box;
					overflow: hidden;
					margin-bottom: 20rpx;
					.cpMain{
						width: 100%;
						position: relative;
						.cpBgImg{
							width: 100%;
							position: relative;
							.statusIcon{
								width: 40rpx;
								height: 40rpx;
								border-radius: 50%;
								background: white;
								position: absolute;
								top: 10rpx;
								right: 10rpx;
								image{
									width: 100%;
								}
							}
						}
						.cpContent{
							width: 100%;
							height: 100%;
							position: absolute;
							top: 0;
							left: 0;
							.contentLeft{
								width: 69%;
								height: 100%;
								padding:12rpx 24rpx;
								box-sizing: border-box;
								.content{
									width: 100%;
									.cpDetail{
										flex: 1;
										min-width: calc(100% - 70px);
										.toast{
											color: #666666;
											font-size: 12px;
											margin-bottom: 4rpx;
										}
										.cpName{
											margin-bottom: 4rpx;
											width: 100%;
											overflow: hidden;
											text-overflow: ellipsis;
											white-space: nowrap;
											font-size: 15px;
											font-weight: bold;
										}
										.time{
											color: #666666;
											font-size: 12px;
											margin-bottom: 12rpx;
										}
										.expbtn{
											color: #999999;
											font-size: 12px;
											.exBtn{
												width: 24rpx;
												height: 24rpx;
												margin-left: 8rpx;
											}
										}
									}
									.shopImg{
										width: 128rpx;
										height: 128rpx;
										position: relative;
										margin-right:12rpx;
										image{
											width: 100%;
											height: 100%;
											border-radius: 20rpx;
										}
									}
								}
								.tag{
									font-size: 10px;
									padding: 2px 18rpx;
									color: #FD5605;
									background: #FFF0E8;
									margin-bottom: 8rpx;
									width: max-content;
								}
							}
							.contentRight{
								width: 31%;
								height: 100%;
								padding: 24rpx;
								box-sizing: border-box;
								color: white;
								.useBtn{
									width: max-content;
									padding: 10rpx 16rpx;
									border-radius: 50px;
									background: white; 
									color: #FF5000;
									font-size: 12px;
								}
								.condition{
									font-size: 12px;
									margin-bottom: 10rpx;
								}
								.cpCount{
									font-size: 16px;
									font-weight: bolder;
									text{
										font-size: 34px;
									}
								}
							}
						}
					}
					.explain{
						width: 100%;
						padding: 24rpx;
						box-sizing: border-box;
						color: #999999;
						font-size: 12px;
						background: white;
						line-height: 38rpx;
					}
				}
			}
			.tools{
				color: #999999;
				font-size: 12px;
				margin-bottom: 30rpx;
				padding: 0 24rpx;
				width: 100%;
				box-sizing: border-box;
			}
			.titles{
				width: 100%;
				padding: 40rpx 0;
				font-size: 20px;
				font-weight: bold;
				.line{
					width: 160rpx;
					height: 0;
					border: 0.5px solid #C1C1C1;
					margin: 0 20rpx;
				}
			}
		}
	}
	.zz{
		color: white;
		font-size:16px;
		.closeBtn{
			width: max-content;
			padding: 8px 50px;
			margin: 10px auto;
			font-size: 12px;
			border-radius: 30px;
			color: white;
			border: 1px solid white;
		}
		.advImg{
			margin-bottom: 10px!important;
		}
		.opBtns{
			width: 100%;
			position: absolute;
			bottom: 0;
			left: 0;
			background: white;
			padding:0 0 25px;
			box-sizing: border-box;
			.toast{
				width: 100%;
				text-align:center;
				padding:12px 0;
				color:#666666;
			}
			.close{
				width: 94%;
				margin:6px auto 0;
				text-align:center;
				color:#666666;
				font-size:12px;
			}
			.btns{
				width: 100%;
				.opBtnOne{
					width: max-content;
					text-align: center;
					font-size: 12px;
					color: #333333;
					.btnImg{
						width: 45px;
						height: 45px;
						margin-bottom: 8px;
					}
				}
			}
		}
	}
	.zz2{
		top: 0;
		// left:-100%;
		left:0;
		position: fixed;
	}
	.bottomBtn{
		width: 100%;
		background: white;
		position: fixed;
		bottom: 0;
		left:0;
		padding: 16rpx 24rpx;
		box-sizing: border-box;
		.opBtns{
			width:27.5%;
			.smallMenu{
				// width: 30%;
				width:42.5%;
				text-align: center;
				font-size:12px;
				position: relative;
				.count{
					width: 34rpx;
					height: 34rpx;
					border-radius: 50%;
					text-align: center;
					line-height: 34rpx;
					background: #FF5000;
					position: absolute;
					top: -17rpx;
					right: -17rpx;
					color: #FDD100;
					font-size: 12px;
				}
				.menuIcon{
					width: 40rpx;
					height: 40rpx;
					margin:0 auto 4rpx;
				}
			}
		}
		.tj{
			// width: auto;
			flex: 1;
			.allCount{
				.line2{
					width:100%;
					text-align: right;
					font-size: 12px;
					text{
						color: #FC4424;
					}
				}
				.resultPrice{
					text{
						color: #FF6200;
						font-size: 20px;
						font-weight: bold;
					}
				}
			}
			.payBtn{
				width: max-content;
				padding: 22rpx 42rpx;
				color: white;
				border-radius: 50px;
				background: linear-gradient(180deg, #FC9700 0%, #FF5000 100%);
				margin-left: 20rpx;
			}
			.startTxt{
				color: #FF6200;
				font-weight: bold;
				display:inline-block;
				margin-left: 10px;
			}
		}
		.unStart{
			width: 100%;
			padding: 10px 20px;
			box-sizing: border-box;
			background: rgba(255,98,0,0.3);
			color: #FF6200;
			border-radius: 50px;
			font-size: 14px;
		}
	}
	.shops{
		background: white;
		min-height:65vh;
		.list{
			width: 100%;
			padding: 24rpx 24rpx 40rpx;
			box-sizing: border-box;
			.shopOne{
				width: 100%;
				margin-bottom: 20rpx;
				.shopInfo{
					flex: 1;
					.config{
						width: 100%;
						.priceTag{
							width: 100%;
							font-size: 12px;
							margin-bottom: 6rpx;
							.miaosha{
								width: max-content;
								background: linear-gradient(180deg, #FF6200 0%, #FE3140 100%);
								color: white;
								border: 1px solid #FF6200;
							}
							.jiang{
								color: #FF6200;
								border: 1px solid #FF6200;
							}
							view{
								padding: 0 8px;
								line-height: 36rpx;
								border-radius: 8rpx;
								margin-right:4rpx;
							}
							.xgNum{
								flex: 1;
								text-align: right;
								font-size: 12px;
								color: #999999;
							}
						}
						.tools{
							width: 100%;
							.count{
								width:auto;
								.smallIpt{
									width:54rpx;
									height:54rpx;
									margin:0 12rpx;
									input{
										width:54rpx;
										height:54rpx;
										text-align:center;
										line-height:54rpx;
									}
								}
								.smallBtn{
									width:54rpx;
									height:54rpx;
									image{
										width:54rpx;
										height:54rpx;
									}
								}
							}
							.showPrice{
								color: #FF6200;
								font-size: 12px;
								text{
									font-size: 20px;
									font-weight: bold;
								}
							}
						}
					}
					.bar{
						width: 100%;
						font-size: 12px;
						color: #999999;
						margin-bottom:50rpx;
						.barContent{
							flex: 1;
						}
						.progress{
							width: 39%;
							margin-right: 12rpx;
							height: 20rpx;
							background: #F6F6F6;
							border-radius: 10rpx;
							overflow: hidden;
							.current{
								width: 0;
								height: 100%;
								border-radius: 10rpx;
								background: #FF6200;
							}
						}
					}
					.spec{
						margin: 20rpx 0;
						font-size: 12px;
						color: #999999;
					}
					.shopName{
						width: 100%;
						font-size: 15px;
						font-weight: bold;
						line-height: 20px;
						// margin-bottom: 18rpx;
						
						white-space: normal;
						overflow: hidden;
						-webkit-line-clamp: 2;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-box-orient: vertical;
					}
				}
				.shopImg{
					width: 254rpx;
					height: 254rpx;
					border-radius: 4px;
					margin-right: 16rpx;
					overflow: hidden;
					position: relative;
					image{
						width: 254rpx;
						height: 254rpx;
					}
				}
			}
			.shopOne:last-child{
				margin-bottom: 0;
			}
			.hui{
				.shopInfo{
					.config{
						width: 100%;
						.priceTag{
							width: 100%;
							font-size: 12px;
							margin-bottom: 6rpx;
							.miaosha{
								width: max-content;
								background: #999999;
								color: white;
								border: none
							}
							.jiang{
								color: #999999;
								border: 1px solid #999999;
							}
						}
						.tools{
							width: 100%;
							.showPrice{
								color: #999999;
							}
						}
					}
					.bar{
						.progress{
							background: #F6F6F6;
							.current{
								background: #DFDFDF;
							}
						}
					}
				}
			}
		}
		.quan{
			width: 100%;
			background: #FDF1F1;
			margin-bottom: 3px;
			padding-right: 12px;
			box-sizing: border-box;
			.quanContent{
				flex: 1;
				.quanIcon{
					width: 80rpx;
					margin-right: 12rpx;
				}
				text{
					color: #FF5000;
				}
			}
			.time{
				font-size: 12px;
				color: #666666;
				.rightIcon{
					width: 24rpx;
					margin-left: 4rpx;
				}
			}
		}
		.menus{
			width: 92%;
			margin:24rpx auto;
			white-space: nowrap;
			overflow: hidden;
			overflow-x: auto;
			.menuOne{
				display: inline-block;
				vertical-align: middle;
				width: max-content;
				padding: 6rpx 20rpx;
				border-radius: 4rpx;
				background: #F7F7F7;
				margin-right: 20rpx;
				.menuIcon{
					width: 34rpx;
					height: 34rpx;
					margin-right: 4rpx;
				}
			}
			.menuOne:nth-child(2){
				color: #FF5000;
			}
			.active{
				color: #FF5000;
				background:#FDEFEE;
			}
		}
		.timeSlot{
			width: 92%;
			padding: 20rpx 0 0;
			border-bottom: 1px solid #EAEAEA;
			font-size: 16px;
			margin: 0 auto;
			.timeOne{
				flex: 1;
				text-align: center;
				.line{
					width: 40rpx;
					height: 6rpx;
					border-radius: 30rpx;
					background: white;
					margin: 10rpx auto 0;
				}
			}
			.active{
				color: #FF4600;
				font-weight: 500;
				.line{
					background: #FF4600;
				}
			}
		}
		width: 100%;
		padding-top: 10rpx;
		border-radius: 40rpx 40rpx 0 0;
	}
	.topContent{
		width: 100%;
		position: relative;
		.content{
			.teamInfo{
				width: 100%;
				padding: 22rpx 26rpx 22rpx;
				box-sizing: border-box;
				color: white;
				border: 1px solid white;
				border-radius: 6px;
				position: relative;
				margin: 30rpx 0;
				// top: -30px;
				.info{
					width: calc(100% - 45px);
					.zt{
						width: 100%;
						margin: 0 0 8rpx;
						.shop{
							width: auto;
							margin-right: 8rpx;
							// font-size:15px;
							// font-weight: bold;
						}
						.time{
							width: auto;
							padding: 4rpx 10rpx;
							background: white;
							border-radius: 4px;
							color:#FF5000;
						}
					}
					.ztAdd{
						width: 100%;
						font-size: 12px;
						.exchange{
							width:auto;
							margin-left: 8px;
						}
						.add{
							width: 90%;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}
					}
				}
				.teamImg{
					width: 74rpx;
					height: 74rpx;
					margin-right: 16rpx;
					border-radius: 4px;
					overflow: hidden;
					image{
						width: 100%;
						max-height: 100%;
						border-radius: 4px;
					}
				}
			}
			.shopPart{
				.shops{
					.shopOne{
						width: 35%;
						display: inline-block;
						margin-right: 40rpx;
						.shopInfo{
							.tools{
								width: 100%;
								.showPrice{
									color: #FF6200;
									font-size: 12px;
									text{
										font-size: 20px;
										font-weight: bold;
									}
								}
							}
							.priceTag{
								width: 100%;
								font-size: 12px;
								margin: 5px 0;
								.miaosha{
									width: max-content;
									background: linear-gradient(180deg, #FF6200 0%, #FE3140 100%);
									color: white;
									border: 1px solid #FF6200;
								}
								.jiang{
									color: #FF6200;
									border: 1px solid #FF6200;
								}
								view{
									padding: 0 4px;
									line-height: 36rpx;
									border-radius: 8rpx;
									margin-right:4rpx;
								}
								.xgNum{
									flex: 1;
									text-align: right;
									font-size: 12px;
									color: #999999;
								}
							}
							.shopName{
								white-space: normal;
								overflow: hidden;
								-webkit-line-clamp: 2;
								text-overflow: ellipsis;
								display: -webkit-box;
								-webkit-box-orient: vertical;
							}
							width: 100%;
						}
						.shopImg{
							width: 100%;
							max-height: 168px;
							position: relative;
							overflow: hidden;
							image{
								border-radius: 5px;
							}
						}
					}
					width: 100%;
					overflow: hidden;
					overflow-x: auto;
					white-space: nowrap;
				}
				.tits{ 
					width: 100%;
					margin-bottom: 24rpx;
					.haveUsers{
						width: auto;
						.userTx{
							position: relative;
							right:-35px;
							margin-right: 10rpx;
							.txOne{
								display: inline-block;
								width: 42rpx;
								height: 42rpx;
								border-radius: 50%;
								overflow: hidden;
								position: relative;
								z-index: 2;
								image{
									height: 100%;
								}
							}
							.txOne:last-child{
								transform: translateX(0);
							}
						}
					}
					.titImg{
						width: 233rpx;
					}
				}
				width: 100%;
				background: white;
				border-radius: 20rpx;
				padding: 24rpx;
				box-sizing: border-box;
			}
			.endTime{
				color:white;
				margin: 20rpx 0;
				.showTime{
					margin-left: 16rpx;
				}
			}
			width: 100%;
			// height: 100%;
			// position: absolute;
			// top: 0;
			// left: 0;
			overflow: hidden;
			padding-left:3%;
			padding-right: 3%;
			box-sizing: border-box;
		}
	}
	.ios_pageTitle,.and_pageTitle{
		.pageTitle{
			.backIcon{
				width: 56rpx;
			}
			.searchBox{
				width: 60%;
				background: white;
				border-radius: 40px;
				padding: 12rpx 24rpx;
				box-sizing: border-box;
				margin-left: 24rpx;
				.searchIcon{
					width: 30rpx;
					margin-right: 8rpx;
				}
			}
		}
	}
</style>